package modelo;

public class Coordenada {
	
	protected Integer x;
	protected Integer y;
	
	public Coordenada(Integer x, Integer y) {
		super();
		this.x = x;
		this.y = y;
	}
	
	public Integer getX() {
		return x;
	}
	
	public void setX(Integer x) {
		this.x = x;
	}
	
	public Integer getY() {
		return y;
	}
	
	public void setY(Integer y) {
		this.y = y;
	}
	
	public String toString() {
		return "[" + this.x + " - " + this.y + "]";
	}
	
	@Override
	public boolean equals(Object obj) {
		Coordenada coord = (Coordenada) obj;
		return coord.getX().equals(this.getX()) && coord.getY().equals(this.getY()); 
	}
	
	@Override
	public int hashCode() {
		return (this.x + "-" + this.y).hashCode();
	}
}
